package com.company;

import com.company.method.HondaCarFactory;
import com.company.method.ProductCar;
import com.company.method.ProductCarFactory;
import com.company.method.ToyotaCarFactory;

/**
 * 工厂方法模式代码测试
 */
public class TestForMethod {

    public static void main(String[] args) {
        //生产本田汽车
        ProductCarFactory hondaCarFactory = new HondaCarFactory();
        ProductCar hondaCar = hondaCarFactory.getProductCar();
        hondaCar.product();

        //生产丰田汽车
        ProductCarFactory toyotaCarFactory = new ToyotaCarFactory();
        ProductCar toyotaCar = toyotaCarFactory.getProductCar();
        toyotaCar.product();
    }
}
